<style>
.el-menu--inline{
  background-color: #000c17 !important;
}
.el-menu--inline .el-menu-item{
  background-color: #000c17 !important;
  padding-left: 50px !important;
}
.el-menu-item:hover,.el-submenu__title:hover{
  color: #fff !important;
}
.el-submenu__title :hover i {
  color: #fff !important;
}
.el-menu-item.is-active{
  background-color: #1890ff !important;
  border-radius: 5px;
  margin: 4px;
}
.el-menu-item{
  height: 40px !important;
  line-height: 40px !important;
  margin: 4px;
}
.el-submenu__title{
  height: 40px !important;
  line-height: 40px !important;
  margin: 4px;
}
.el-submenu .el-menu-item{
  min-width: 0 !important;
}
.el-aside {
  transition: width .3s;
  box-shadow: 2px 0 6px rgba(0,21,41,35);
}
.logo-style{
  margin-left: 5px;
  font-size: 20px;
  transition: width .3s;
}
.el-header{
  box-shadow: 2px 0 6px rgba(0,21,41,35);
  display: flex;
  align-items: center;

}
</style>



<template>
  <div >
   <el-container>
<!--     侧边栏-->
     <el-aside :width="asideWidth" style="min-height: 100vh;background-color: #001529">
       <div style="height: 60px;color: white;display: flex;align-items: center;justify-content: center">
         <img src="@/assets/logo.png" alt="" style="width: 25px;height: 25px">
         <span class="logo-style" style="margin-left: 5px;font-size: 20px;" v-show="!isCollapse" >管理系统</span>
       </div>
       <el-menu router style="border: none" :collapse="isCollapse" :collapse-transition="false" background-color="#001529" text-color="rgba(255,255,255,0.65)" active-text-color="#fff" :default-active="$route.path">

         <el-menu-item index="/">
           <i class="el-icon-s-home"></i>
           <span slot="title">系统首页</span>
         </el-menu-item>

         <el-menu-item index="/element">
           <i class="el-icon-s-home"></i>
           <span slot="title">element页面</span>
         </el-menu-item>

         <el-menu-item index="/2">
           <i class="el-icon-s-home"></i>
           <span slot="title">系统首页</span>
         </el-menu-item>

         <el-submenu index="/">
           <template slot="title">
             <i class="el-icon-menu"></i>
             <span>用户管理</span>
           </template>
           <el-menu-item>用户信息</el-menu-item>
           <el-menu-item index="/">管理员信息</el-menu-item>
         </el-submenu>
       </el-menu>
     </el-aside>

     <el-container>
<!--       头部-->
       <el-header>
         <i :class="collapseIcon" style="font-size: 25px; color: green" @click="handleCollapse"></i>
         <el-breadcrumb separator-class="el-icon-arrow-right">
           <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
           <el-breadcrumb-item :to="{ path: '/user' }">用户管理</el-breadcrumb-item>
         </el-breadcrumb>

         <div style="flex: 1;width: 0;display: flex;align-items: center;justify-content: flex-end">
           <el-dropdown placement="bottom">
             <div style="display: flex;align-items: center;cursor: default" >
               <i class="el-icon-full-screen" style="font-size: 25px" @click="handleFulls"></i>
               <img src="@/assets/logo.png" alt="" style="width: 25px;height: 25px;margin: 0 6px">
               <span>管理员</span>
             </div>
             <el-dropdown-menu slot="dropdown">
               <el-dropdown-item>个人信息</el-dropdown-item>
               <el-dropdown-item>修改密码</el-dropdown-item>
               <el-dropdown-item>退出登录</el-dropdown-item>

             </el-dropdown-menu>
           </el-dropdown>

         </div>

       </el-header>
<!--       主体-->
       <el-main>
         主体
       </el-main>
     </el-container>


   </el-container>
  </div>
</template>

<script>


export default {
  name: 'HomeView',
  data() {
    return{
      isCollapse:false,//不收缩
      asideWidth:'200px',
      collapseIcon:'el-icon-s-fold',
    }
  },
  methods:{
    handleCollapse(){
      this.isCollapse = !this.isCollapse
      this.asideWidth = this.isCollapse ? '64px' : '200px'
      this.collapseIcon = this.isCollapse ? 'el-icon-s-unfold' : 'el-icon-s-fold'
    },
    handleFulls(){
      document.documentElement.requestFullscreen()//设置全屏
    }
  }
}
</script>
